﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using HAVNet.Core.LitJson;

namespace yiracli
{
    public class WorkLog
    {
        public static string get (Autorizacion auto, Issue issue)
        {
            string url = string.Format(
                "http://sm-jiratest:8080/rest/api/latest/issue/{0}/worklog",
                issue.key
            );

            HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
            req.ContentType = "application/json";
            req.Headers.Add("Authorization", "Basic " + auto.basic64);
            req.Method = "GET";

            HttpWebResponse resp = req.GetResponse() as HttpWebResponse;

            string respuesta = resp.leer();
            JsonData jdata = JsonMapper.ToObject(respuesta);

            return respuesta;
        }
    }
}
